package com.SkiOnSofa;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class SkiOnSofa extends TabActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Reusable TabSpec for each tab
        
        // Create an Intent to launch an Activity for the tab (to be reused)
        Intent intentBuscador = new Intent().setClass(this, Buscador.class);
        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("buscador").setIndicator(getString(R.string.buscador_tab_name),
        		res.getDrawable(R.drawable.ic_tab_buscador)).setContent(intentBuscador);
        tabHost.addTab(spec);  
        
        Intent intentMapa = new Intent().setClass(this, Mapa.class);
        spec = tabHost.newTabSpec("mapa").setIndicator(getString(R.string.mapa_tab_name),
        		res.getDrawable(R.drawable.ic_tab_mapa)).setContent(intentMapa);
        tabHost.addTab(spec);

        Intent intentClassificacio = new Intent().setClass(this, Classificacio.class);
        spec = tabHost.newTabSpec("records").setIndicator(getString(R.string.records_tab_name),
        		res.getDrawable(R.drawable.ic_tab_classificacio)).setContent(intentClassificacio);
        tabHost.addTab(spec);      
        
        tabHost.setCurrentTab(0);
    }
}
